package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.VerBlogMapper;
import com.ruoyi.system.domain.VerBlog;
import com.ruoyi.system.service.IVerBlogService;

/**
 * 博客Service业务层处理
 * 
 * @author liuhuizhong
 * @date 2025-08-16
 */
@Service
public class VerBlogServiceImpl implements IVerBlogService 
{
    @Autowired
    private VerBlogMapper verBlogMapper;

    /**
     * 查询博客
     * 
     * @param blogId 博客主键
     * @return 博客
     */
    @Override
    public VerBlog selectVerBlogByBlogId(Long blogId)
    {
        return verBlogMapper.selectVerBlogByBlogId(blogId);
    }

    /**
     * 查询博客列表
     * 
     * @param verBlog 博客
     * @return 博客
     */
    @Override
    public List<VerBlog> selectVerBlogList(VerBlog verBlog)
    {
        return verBlogMapper.selectVerBlogList(verBlog);
    }

    /**
     * 新增博客
     * 
     * @param verBlog 博客
     * @return 结果
     */
    @Override
    public int insertVerBlog(VerBlog verBlog)
    {
        verBlog.setCreateTime(DateUtils.getNowDate());
        return verBlogMapper.insertVerBlog(verBlog);
    }

    /**
     * 修改博客
     * 
     * @param verBlog 博客
     * @return 结果
     */
    @Override
    public int updateVerBlog(VerBlog verBlog)
    {
        verBlog.setUpdateTime(DateUtils.getNowDate());
        return verBlogMapper.updateVerBlog(verBlog);
    }

    /**
     * 批量删除博客
     * 
     * @param blogIds 需要删除的博客主键
     * @return 结果
     */
    @Override
    public int deleteVerBlogByBlogIds(Long[] blogIds)
    {
        return verBlogMapper.deleteVerBlogByBlogIds(blogIds);
    }

    /**
     * 删除博客信息
     * 
     * @param blogId 博客主键
     * @return 结果
     */
    @Override
    public int deleteVerBlogByBlogId(Long blogId)
    {
        return verBlogMapper.deleteVerBlogByBlogId(blogId);
    }
}
